Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: translate audio channels and devices list #520

Merged
merged 1 commit into from
Apr 25, 2023

Conversation

po5
Copy link
Contributor

@po5 po5 commented Apr 24, 2023

The channel count in track list couldn't be translated.
Also translate mpv's hardcoded entries in the audio devices list.

@natural-harmonia-gropius
Copy link
Contributor

natural-harmonia-gropius commented Apr 25, 2023

I will update zh-hans after this PR is merged.
Also, should the "No file" in title bar be translated?

Update:
https://github.com/natural-harmonia-gropius/uosc/tree/intl-topbar

@tomasklaen
Copy link
Owner

I've just pushed support for dynamic localization strings. It's just a cached lua string.format(), so if you rebase, you can swap this to:

device.description:sub(1, 7) == 'Default' and t('Default %s', device.description:sub(8)) or t(device.description)

and

t('%d channels', track['audio-channels'])

@po5
Copy link
Contributor Author

po5 commented Apr 25, 2023

Used device.description:sub(9), 9 instead of 8, to prevent a double space, since device.description already has a space in it Default (device name).
8 means having the translation string be Default%s to prevent the double space, looked uglier than Default %s.

@tomasklaen tomasklaen merged commit f403f92 into tomasklaen:main Apr 25, 2023
@tomasklaen
Copy link
Owner

Whoops, missed that you're using %d in there. I guess just switch %s that are not %s in your other PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants